package com.eight.clientcourse.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eight.common.pojo.EduTeacher;
import com.eight.common.pojo.TbShoucangTeacher;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: qy8-education1
 * @description:
 * @author: 张亚祥
 * @create: 2023-06-03 16:13
 **/
public interface ShouCangTeacherDao extends BaseMapper<TbShoucangTeacher> {

    @Select(value = "select t.status from tb_shoucang_teacher st join edu_teacher t on st.teacher_id = t.id join tb_member m on st.member_id = m.id ")
    List<EduTeacher> addByTeacherStatus(QueryWrapper<EduTeacher> wrapper);

    @Select(value = "select t.* from tb_shoucang_teacher st join edu_teacher t on st.teacher_id = t.id join tb_member m on st.member_id = m.id where t.id=#{teacherId} and m.id=#{memberId}")
    EduTeacher findByTeacherStatus(String teacherId,String memberId);


}
